package com.esiag.isidis.fi.service;

import com.esiag.isidis.fi.pdsteam.dao.SensorDAO;
import com.esiag.isidis.fi.pdsteam.entity.Message;
import com.esiag.isidis.fi.pdsteam.entity.RawByteObject;
import com.esiag.isidis.fi.pdsteam.entity.Sensor;

public class Coordinator {

	public Message parse(RawByteObject rawByteObject, String string) {
		IParser dataParser = new DataParser();
		Message message = dataParser.parse(rawByteObject, "pathFileConfig");
		return message;
	}

	public Sensor getSensor(Message message) {
		SensorDAO sensorDAO = new SensorDAO();
		Sensor sensor = sensorDAO.getSensor(message);
		return sensor;
	}

	public void dispatche(Message message, Sensor sensor) {
		MessageDispatcher dispatcher = new MessageDispatcher();
		dispatcher.dispatche(message, sensor);
	}

}
